import { setGoodsIsPrivate, setGoodsIsPrivateBatch } from "@/api/service/goods/goods";

import { selectedKeys } from "./table";

const t = translate("公共模块");

// const getResult = (result: IResponse<any>) => {
//   if (result.code === 200) {
//     Message.success(result.msg);
//   }
// };

export const shareOptions = [
  {
    title: "所有商品公开",
    async action() {
      await setGoodsIsPrivate(1);
    }
  },
  {
    title: "所有商品私有",
    async action() {
      await setGoodsIsPrivate(0);
    }
  },
  {
    title: "选中商品公开",
    async action() {
      await setGoodsIsPrivateBatch(1, selectedKeys.value);
    }
  },
  {
    title: "选中商品私有",
    async action() {
      await setGoodsIsPrivateBatch(0, selectedKeys.value);
    }
  }
];
